﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/signalR")
    <script type="text/javascript" src="/signalr/hubs"></script>
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <a class="brand" href="@Url.Action("Index", "Home")">Battleborn</a>
                <div class="nav-collapse collapse">


                    @if (!Request.IsAuthenticated)
                    {
                        <ul class="nav">
                            <li class="active"><a href="@Url.Action("Index", "Home")">Home</a></li>
                            <li><a href="@Url.Action("About", "Home")">About</a></li>
                            <li><a href="@Url.Action("Register", "Account")">Register</a></li>
                            <li><a href="@Url.Action("Index", "Battle")">Battle</a></li>
                        </ul>
                        using (Html.BeginForm("Login", "Account", FormMethod.Post, new { @class = "navbar-form pull-right" }))
                        {
                        @Html.AntiForgeryToken()
                        <input class="span2" id="UserName" name="UserName" type="text" placeholder="Username">
                        <input class="span2" id="Password" name="Password" type="password" placeholder="Password">
                        <button type="submit" class="btn btn-primary" value="Log in">Sign in</button>
                        }
                    }
                    else
                    {
                        <ul class="nav">
                            <li class="active"><a href="@Url.Action("Index", "Home")">Home</a></li>
                            <li><a href="@Url.Action("About", "Home")">About</a></li>
                            <li><a href="@Url.Action("Register", "Account")">Register</a></li>
                            <li><a href="@Url.Action("Battle", "Battle")">Battle</a></li>
                            <li><a href="@Url.Action("Profile", "Account")">@User.Identity.Name</a></li>
                        </ul>
                        using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { @class = "navbar-form pull-right" }))
                        {
                        @Html.AntiForgeryToken()
                        <button type="submit" class="btn btn-primary pull-right" value="Log off">Log Off</button>
                        }
                    }
                </div>
                <!--/.nav-collapse -->
            </div>
        </div>
        <div class="container">
            @RenderBody()
        </div>
    </div>

    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>
